import * as mongoose from 'mongoose';

export const LcTagSchema = new mongoose.Schema(
  {
    projectId: {
      type: mongoose.Schema.Types.ObjectId,
      required: true,
      index: true,
    },
    name: {
      type: String,
      required: true,
    },
    commitId: {
      type: mongoose.Schema.Types.ObjectId,
      required: true,
      index: true,
    },
    description: {
      type: String,
      required: false,
    },
    createdAt: {
      type: Number,
      required: true,
    },
    createdBy: {
      type: Number,
      required: true,
      index: true,
    },
    meta: {
      type: new mongoose.Schema(
        {
          version: {
            type: String,
            required: false,
          },
          moduleId: {
            type: String,
            required: false,
          },
        },
        { _id: false }
      ),
      required: false,
    },
  },
  {
    timestamps: true,
    collection: 'lc_tags',
  }
);
